package com.example.myDesignPatterns.行为型模式.命令模式Command;

public class Client {
    public static void main(String[] args) {
        Order order = new Order();
        order.setDiningTable(1);
        order.getFoodDic().put("西红柿鸡蛋面", 1);
        order.getFoodDic().put("小杯可乐", 2);

        Order order1 = new Order();
        order1.setDiningTable(3);
        order1.getFoodDic().put("宫保鸡丁", 1);
        order1.getFoodDic().put("大杯可乐", 2);

        //创建接收者
        SeniorChef receiver = new SeniorChef();
        //将订单和接收者封装成命令对象
        OrderCommand cmd = new OrderCommand(receiver,order);
        OrderCommand cmd1 = new OrderCommand(receiver,order1);
        //创建调用者
        Waitor waitor = new Waitor();
        waitor.setCommand(cmd);
        waitor.setCommand(cmd1);
        //将订单带到柜台 并向厨师喊 订单来了
        waitor.orderUp();
    }
}
